fix(settings): activate hooks for entire enable --local#1149
Open
ivasuy wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1123.
This PR switches
IsSetUpAndEnabledtoIsSetUpAny, which already exists and correctly checks for either file.Load()already merges both files and defaultsEnabled: truewhen only the local file is present, so the loaded value was always correct. The only broken piece was the presence check.Changes
cmd/entire/cli/settings/settings.goIsSetUpAndEnablednow callsIsSetUpAny(ctx)instead ofIsSetUp(ctx).cmd/entire/cli/settings/settings_test.goTestIsSetUpAndEnabled_LocalOnlyTestIsSetUpAndEnabled_LocalOnlyDisabledTestIsSetUpAndEnabled_NoFilesTestIsSetUpAndEnabled_BaseOnlyEnabledsetupSettingsRepohelper usingtestutil.InitReposopaths.WorktreeRoot()resolves correctly throughAbsPath.setupSettingsDirfor fake.gitdirectory cases, but avoided using it for tests that need real path resolution.Verification
Result:
go test ./cmd/entire/cli/settings/ -run TestIsSetUpAndEnabled -vResult:
I also confirmed the new
TestIsSetUpAndEnabled_LocalOnlyregression test fails onmainwithout the one-line fix and passes with it. That confirms the test locks in the actual fix instead of asserting tautologically.End-to-end smoke test:
entire enable --localentire/checkpoints/v1.Before the fix, the same flow produced no shadow branch and no checkpoint.